package action.album;

import org.apache.struts2.ServletActionContext;

import service.AlbumService;
import bean.Album;
import bean.User;

import com.opensymphony.xwork2.ActionSupport;

public class CheckAlbumAction extends ActionSupport {
	private Album album;
	private AlbumService albumService;
	
	@Override
	public String execute() throws Exception {
		User u=(User) ServletActionContext.getContext().getSession().get("user");
		ServletActionContext.getRequest().setAttribute("albums", albumService.getAlbumsByUserid(u.getId()));
		album=albumService.getAlbumById(album.getId());
		return SUCCESS;
	}

	public Album getAlbum() {
		return album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}

	public AlbumService getAlbumService() {
		return albumService;
	}

	public void setAlbumService(AlbumService albumService) {
		this.albumService = albumService;
	}
	
	
}
